package com.fz.us.admin.company.service;

import com.fz.us.admin.base.bean.Result;
import com.fz.us.admin.base.bean.search.order.Order;
import com.fz.us.admin.base.bean.search.page.PagePaging;
import com.fz.us.admin.base.bean.search.result.SearchResultPaging;
import com.fz.us.admin.base.bean.search.rule.Rule;
import com.fz.us.admin.base.service.BaseService;
import com.fz.us.admin.company.entity.Company;
import com.fz.us.admin.company.entity.CompanyFormEntity;
import com.fz.us.admin.company.entity.Duty;
import com.fz.us.admin.company.entity.User;

import java.util.List;
import java.util.Map;

/**
 * Service接口 - 企业表单 基接口
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author fallenpanda
 * @version 1.0 2016-09-06 。
 * ============================================================================
 */
public interface CompanyFormService<T extends CompanyFormEntity> extends BaseService<T, String> {

    /**
     * 保存
     *
     * @param user
     * @param duty
     * @param entity
     * @return
     */
    public Result createEntity(User user, Duty duty, T entity);

    /**
     * 修改
     *
     * @param user
     * @param entity
     * @return
     */
    public Result updateEntity(User user, Duty duty, String keyId, T entity);

    /**
     * 操作
     *
     * @param user
     * @param method
     * @param keyId
     * @return
     */
    public Result methodEntity(User user, String method, String keyId);

    /**
     * 列表 Map
     *
     * @param entity
     * @return
     */
    public Map<String, Object> getListMap(T entity);

    /**
     * 详情 Map
     *
     * @param entity
     * @return
     */
    public Map<String, Object> getDetailMap(T entity);

    /**
     * 部门权限
     *
     * @param page
     * @param rules
     * @param order
     * @param company
     * @param user
     * @return
     */
    public SearchResultPaging findCompanyPagingBySearch(PagePaging page, List<Rule> rules, Order order, Company company, User user);

}
